package cn.fl.insurance.service;

import java.util.List;

import cmm.mid.core.framework.page.Pager;
import cn.cmm.base.framework.exception.BaseException;
import cn.fl.insurance.condition.InsPlcApprQueryCondition;
import cn.fl.insurance.dto.InsPlcApprDTO;
import cn.fl.insurance.vo.InsPlcApprVO;
import cn.fl.insurance.vo.InsPlcBscInfoVO;

/**
 * @Description: 批单表 客户端服务层接口
 * 业务层方法名称前缀：
 * 新增：add*
 * 删除：remove*
 * 修改：modify*
 * 批量：batch*
 * 查询对象：select* get*
 * 查询集合：search*
 */
public interface IInsPlcApprService {

    /**
     * 获取唯一对象
     *
     * @param id 主键
     * @return 对象DTO
     */
    public InsPlcApprVO selectById(Long id) throws BaseException;

    /**
     * 新增
     *
     * @param entity
     * @return
     */
    public Long add(InsPlcApprVO entity) throws BaseException;

    /**
     * 新增
     *
     * @param entity
     * @return
     */
    public Boolean add(InsPlcBscInfoVO entity) throws BaseException;

    /**
     * 批量删除
     *
     * @param ids
     * @return
     */
    public boolean removeByIds(List<Long> ids) throws BaseException;

    /**
     * 修改
     *
     * @param entity
     * @return
     */
    public boolean modify(InsPlcApprVO entity) throws BaseException;

    /**
     * 分页查询所有
     *
     * @param page
     * @return
     */
    public Pager searchListPage(Pager page) throws BaseException;

    /**
     * 根据条件查询所有
     *
     * @param condition
     * @return
     */
    public List<InsPlcApprVO> searchList(InsPlcApprQueryCondition condition) throws BaseException;

    /**
     * 查询当前保单的批单最后一条记录
     * @param plcId
     * @return
     */
    public InsPlcApprDTO selectTopOneByPlcId(Long plcId);

    /**
     * 查询当前批单的批单最后一条记录
     * @param apprId
     * @return
     */
    public InsPlcApprDTO selectLastByApprId(Long apprId);

    /**
     * 验证批单号是否唯一
     * @return
     * @throws BaseException
     */
    public boolean validateApprCode(String apprCode) throws BaseException;
}
